package Single;

public class Card {
    private String cardID;
    private int money;

    public Card(String cardID,int money){
        this.cardID = cardID;
        this.money = money;
    }
    public void drawmoney(int money){
        String name=Thread.currentThread().getName();
        if(this.money>=money){
            System.out.println(name+"取钱成功");
            this.money-=money;
            System.out.println(name+"取钱后余额："+this.money);
        }else{
            System.out.println(name+"取钱失败");
        }
    }
}
